package com.cheetah.start.module.system.controller;

import com.cheetah.start.common.base.result.Result;
import com.cheetah.start.common.base.result.ResultController;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Post;
import org.noear.solon.core.handle.ModelAndView;
import org.noear.solon.validation.annotation.NotBlank;


/**
 * 文件控制器
 *
 * @author xjh
 * @date 2022/09/09
 */
@Slf4j
@Controller
@Mapping("/system/file")
public class SysFileController extends ResultController {


    /**
     * 列表页面
     *
     * @return {@link ModelAndView}
     */
    @Mapping()
    @Get
    public ModelAndView list() {
        return listView("/file/list");
    }


    @Post
    @Mapping("/test")
    public Result test(@NotBlank(message = "r not blank") String r, @NotBlank(message = "s not blank") String s) {
        return success(r + "||" + s);
    }
}
